package com.example.rabbitmqdemo.springbootMQ.controller;

import com.example.rabbitmqdemo.springbootMQ.simple.HelloSender1;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rabbit")
public class RabbitTest {

    @Autowired
    private HelloSender1 helloSender1;

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/hello")
    public void hello() {
        helloSender1.send();
    }
}